<link href="/stylesheets/tabheader.css" rel="stylesheet" type="text/css" />
<table width="100%" class="noborder_padding">
  <tr>
    <td width="200px" valign="top">
      <%=render :partial=>"sidemenu"%>
    </td>
    <td valign="top" style="padding-left: 10px;">
      <%=render :partial=>"tabheader"%>
      <h3><font color="#804040">General Information</font><%if @word%><font color="red"><i> &nbsp;&nbsp;&nbsp; "<%=@word%>"</i></font><%end%></h3>
      <form action="/project/general_page_save" method="post">
      <table class="noborder" width="100%">
        <tr>
          <td>Name</td>
          <td><input type="text" name="name" value="<%=@project.name%>" style="width:500px;"/></td>
        </tr>
        <tr>
          <td>Parent</td>
          <td>
            <select name="parent_id" style="width:500px;">
              <option value="0">-- ไม่มี --</option>
              <%@all_projects.each do |p|%>
                <%if !p.split('|').include? "#{@project.id}"%>
                  <%rp = Project.find(:first, :conditions=>["id=?", p.split('|').last], :order=>"id")%>
                  <%if rp%>
                  <option value="<%=rp.id%>" <%if rp.id==@project.parent_id%>selected<%end%>><%=project_label(p)%></option>
                  <%end%>
                <%end%>
              <%end%>
            </select>
          </td>
        </tr>
        <tr>
          <td>Keyword</td>
          <td><input type="text" name="keyword" value="<%=@project.keyword%>" style="width:500px;"/></td>
        </tr>
        <tr>
          <td>Description</td>
          <td><textarea name="description" style="width:500px;"><%=@project.description%></textarea></td>
        </tr>
        <tr>
          <td>Secret</td>
          <td><%=@project.gencode%></td>
        </tr>
        <tr>
          <td>Owner</td>
          <td>
            <%begin%>
              <%owner = User.find(@project.user_id)%>
              <%=owner.title%><%=owner.firstname%> <%=owner.lastname%> [<%=owner.username%>]
            <%rescue%>
            <%end%>
          </td>
        </tr>
        <tr>
          <td>Created At</td>
          <td><%=@project.created_at%></td>
        </tr>
        <tr>
          <td>Latest Update</td>
          <td><%=@project.updated_at%></td>
        </tr>
        <%if @project.shared%>
          <tr>
            <td>Shared from</td>
            <td><%=@project.shared%></td>
          </tr>
        <%end%>
        <tr>
          <td colspan="2" align="center"><input type="submit" value="Save"/></td>
        </tr>
      </table>
      </form>
      <center>
        <%=link_to("Delete Project", { :action => "delete_flag_save", :id => "#{@project.gencode}" }, :confirm => "Are you sure?")%>
      </center>
    </td>
  </tr>
</table>